import { createI18n } from "vue-i18n";
import zh from "./modules/zh";
import en from "./modules/en";
import elementEnLocale from 'element-plus/es/locale/lang/en' // element-ui lang
import elementZhLocale from 'element-plus/es/locale/lang/zh-cn' // element-ui lang
// import elementEsLocale from 'element-plus/es/locale/lang/es' // element-ui lang
// import elementJaLocale from 'element-plus/es/locale/lang/ja' // element-ui lang

const i18n = createI18n({
	legacy: false, // 如果要支持 compositionAPI，此项必须设置为 false
	locale: "zh", // 设置语言类型
	globalInjection: true, // 全局注册$t方法
	messages: {
		zh,
		en
	}
});

export const messages = {
	en: {
		...en,
		...elementEnLocale
	},
	zh: {
		...zh,
		...elementZhLocale
	},

}

export default i18n;
